package thread;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

public class Demo28 {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<String> queue = new ArrayBlockingQueue<>(100);
        queue.put("hello");
        String elem = queue.take();
        System.out.println("elem = " + elem);
        elem = queue.take(); // 会进入阻塞状态
        System.out.println("elem = " + elem);
    }
}
